Skip to content

feat(docs): add a send email hook guide eval - #562

Draft
czenko wants to merge 1 commit into
mainfrom
docs/send-email-hook-guide-eval
Draft

czenko wants to merge 1 commit into
mainfrom
docs/send-email-hook-guide-eval

Conversation

@czenko

@czenko czenko commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Closes DOCS-1656

Problem

Nothing measures whether the send email hook guide leads an agent to a hook that delivers working Auth emails. A team routes all mail through its own outbox. Auth's sign-up and password reset emails skip it. With a hook in place, two things go wrong: Auth's database role cannot write to a table with row level security, so sign-up fails, or the email's button points at the wrong URL.

Evidence:

No existing eval covers the send email hook. build-docs-009 covers the custom access token hook, and build-docs-021 follows the standard sign-up email.

Sources reached: Linear, Slack, agent-skills and supabase/supabase issues. Not reached: Hex, Supacademy.

Changes

Adds build-docs-041-send-email-hook. A bookshop sends every email through an outbox table that a worker drains. The prompt asks for the sign-up and reset emails to land in the outbox, finished, with buttons that work, and for the outbox to stay closed to app users. The eval uses a Postgres function hook, the design the page's SQL tab shows. The seed's outbox has row level security on and no policies, which matches the Table Editor and Security Advisor defaults. A hook that writes to it needs a rule for Auth's database role.

The scorer restarts the stack, signs a person up and requests a reset for another, and follows the links in the outbox rows. It follows links on local hosts only.

Checks:

  • The local stack starts with the project settings, and the agent applied the migrations it wrote.
  • Signing up puts the sign-up email in the outbox.
  • The sign-up email's button confirms the person.
  • The password reset email's button opens the new-password page signed in.
  • App users cannot reach outbox rows through exposed tables, views, the email event, or owner-rights functions that name the outbox.
  • The agent read the send email hook guide.

Expected signal: The page's SQL example grants the table to Auth's role, but its table has no row level security. Against the seeded outbox, Auth's insert is refused and sign-up fails. A link built on the page's hardcoded project URL, or one that drops redirect_to, fails the button checks.

What part of the guide this tests:

Guide section Tested How
Inputs: user and email_data Partly Links must use token_hash, site_url and redirect_to
Outputs: an empty 200 is success Indirectly A hook that errors fails the sign-up check
SQL: queue email messages Yes The outbox seed mirrors it, and grants and row level security are tested by behavior
Email change, the dequeue job, the email sending table No Not part of the task
HTTP: Resend, signature verification, internationalization No The edge runtime is not started

Verification

  • pnpm exec biome check evals/docs/build-docs-041-send-email-hook passes.
  • pnpm --filter @supabase-evals/framework typecheck passes.
  • pnpm eval:dry -- --suite docs --eval build-docs-041-send-email-hook plans one pair on codex-gpt-6-luna-no-skills.
  • Baseline: three runs of codex-gpt-6-luna-no-skills in the run-evals-changed run. All three passed all seven checks, including the guide read. A full-marks pass does not show the page carried the run. Braintrust run.

For new or changed evals (see Submitting evals for review):

  • Ran the eval locally, and it completes without framework errors.
  • Ran it in CI with the run-evals-changed label or the Refresh eval results workflow (suite: regression for framework changes), and linked the Braintrust run here.

@czenko czenko added the run-evals-changed Add to a PR to refresh only the benchmark evals that have had changes label Nov 25, 2026
@vercel

vercel Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
evals Ignored Ignored Nov 25, 2026 8:38pm UTC

Request Review

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-evals-changed Add to a PR to refresh only the benchmark evals that have had changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant